const { dbQuery, dbTableName } = require("../db")


const categoryGet = async () => {
    return await dbQuery(`select * from ${dbTableName.categoryTable}`)
}

const categoryAdd = async category_name => {
    return await dbQuery(`insert into ${dbTableName.categoryTable} (category_name) values ('${category_name}')`)
}

const categoryDelete = async category_id => {
    return await dbQuery(`delete from ${dbTableName.categoryTable} where category_id='${category_id}'`)
}

module.exports = {
    categoryGet,
    categoryAdd,
    categoryDelete,
}

